﻿<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
 
    <script type='text/html' template> 
        <input type='hidden' name='PID' value="{{ d.params.PID || '' }}"/>
    </script>    
    <div class='layui-form-item'>
        <label class='layui-form-label'>权限键</label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template lay-done='layui.data.getSelSource(d.params);'>
                    <select name='RightKey_SelSource' readonly='readonly' id='RightKey_SelSource' lay-search></select>
                </script>
            </div>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>权限值</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='RightValue' value='{{ d.params.RightValue || '' }}' lay-verify='required' placeholder='权限值' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>     
    <div class='layui-form-item'>
        <label class='layui-form-label'>权限类型</label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='RightType_Sel'>                      <option value='0' {{ d.params.RightType_Sel == '0' ? 'selected' : '' }}>用户数据权限</option>                      <option value='1' {{ d.params.RightType_Sel == '1' ? 'selected' : '' }}>部门数据权限</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>备注</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Remark' value='{{ d.params.Remark || '' }}' lay-verify='required' placeholder='备注' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div> 
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" onclick="Close()" value="关闭" class="layui-btn">
        </div>
    </div>
</div>

<script type="text/javascript"> 
    
    layui.data.getSelSource = function (d) {
        layui.use(['form', 'admin'], function () {
            var $ = layui.$;
            var form = layui.form;
            var admin = layui.admin;

            admin.req({
                url: layui.setter.APIUrl + '/admin/userMgr/customerQuery', //实际使用请改成服务端真实接口
                type: 'post',
                done: function (res) {
                    $("#RightKey_SelSource").append("<option value=''>全部</option>");
                    layui.each(res.Data, function (index, eachdata) {
                        var strIsSel = '';
                        if (eachdata.PID == d.RightKey_SelSource)
                            strIsSel = "selected='selected'";
                        $("#RightKey_SelSource").append("<option value='" + eachdata.PID + "' " + strIsSel + ">" + eachdata.Name + "[" + eachdata.Code + "]</option>");
                    });
                    form.render('select');
                }
            }); 
        });
    }
 
    
    
    
    layui.use(['form'], function () {
        var form = layui.form;//required（必填项）phone（手机号）email（邮箱）url（网址）number（数字）date（日期）identity（身份证） 自定义值
    });

    function Close() {
        layer.closeAll();
    }
</script>
